package com.lhn.service.impl;

import com.lhn.dao.BookDao;
import com.lhn.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

/**
 * @author lhn
 * @date 2024-08-19 16:26
 */
@Service
public class BookServiceImpl implements BookService {
    @Autowired  //自动注入，通过类型匹配
    @Qualifier("bookDao")   //通过bean名称匹配,@Qualifier依赖@Autowired
    private BookDao bookDao;
    @Override
    public void save() {
        System.out.println("book service save ...");
        bookDao.save();
    }
}
